#include <QtCore/QCoreApplication>
#include <QVector>
#include "../common/comcommandformat.h"
#include "../common/comiocontroller.h"
#include "../common/comcommandparser.h"
#include "command/clientcommandaddserver.h"
#include "command/clientcommandsendcodec.h"
void initCommandInfo(QVector<ComCommandFormat>* cCommandInfo)
{    
    cCommandInfo->push_back( {"AddServer", 2, 2, &ClientCommandAddServer::staticMetaObject} );
    cCommandInfo->push_back( {"SendCodec", 1, 2, &ClientCommandSendCodec::staticMetaObject} );

}



int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    //init command info
    QVector<ComCommandFormat> cCommandInfo;
    initCommandInfo(&cCommandInfo);
    ComCommandParser::m_scCommandInfo = &cCommandInfo;


    QString csInputBuffer;
    ComIOController* cIoController = ComIOController::getInstance();
    ComCommandParser cComParser;
    QStringList cslParsedInput;

    while(true) {
        //read input
        cIoController->getInput(csInputBuffer);
        //parse & execute command
        if( cComParser.parseInput(&csInputBuffer, cslParsedInput) == false )
            ;//Do Nothing //cIoController->msgOutput("<main>:No matched command.", MSG_ERROR);

    }



    return a.exec();
}
